package eteam.aps.systeminterface.model.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Update;

import javax.validation.GroupSequence;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

@Data
@ApiModel(value = "用户信息")
@GroupSequence({Insert.class, Update.class, UserDto.class})
public class UserDto implements Serializable {
    @ApiModelProperty("用户ID")
    @NotBlank(message = "用户ID为空", groups = Update.class)
    public String fuserid;
    @ApiModelProperty("用户名")
    @NotBlank(message = "用户名为空", groups = {Insert.class, Update.class})
    public String fusername;
    @ApiModelProperty("密码")
    @NotBlank(message = "密码为空", groups = {Insert.class})
    public String fpassword;
    @ApiModelProperty("用户全名")
    @NotBlank(message = "用户全名为空", groups = {Insert.class, Update.class})
    public String ffullname;
    //@ApiModelProperty("0:用户 2:角色 默认两个角色: Administrators, AppUser")
    //public Integer fpersontype;
    @ApiModelProperty("人员ID")
    //@NotBlank(message = "职员ID为空", groups = {Insert.class, Update.class})
    public String fpersonid;
    @ApiModelProperty("用户组对应机构")
    @NotBlank(message = "所属机构ID为空", groups = {Insert.class, Update.class})
    public String fgrouporgid;
    // @ApiModelProperty("角色适用机构类型：0机构，10部门，20班组")
    // public Integer funittypeid;
    // @ApiModelProperty("权限：0无权限 1本部门 2本部门及以下 99无限制")
    // public Integer fpermission;

    //@ApiModelProperty("录入人")
    // public String fcreator;
    // @ApiModelProperty("录入人姓名")
    // public String fcreatorname;
    // @ApiModelProperty("录入时间")
    // public Date fcreatetime;
    // @ApiModelProperty("最后修改人")
    // public String flastmodifier;
    // @ApiModelProperty("最后修改人姓名")
    // public String flastmodifiername;
    // @ApiModelProperty("最后修改时间")
    // public Date flastmodifytime;
    // @ApiModelProperty("时间戳")
    // public Date ftimestamp;

    @ApiModelProperty("状态【-1删除 0停用 1启用】")
    @NotNull(message = "状态不合法", groups = {Insert.class, Update.class})
    @Max(value = 1, message = "状态不合法", groups = {Insert.class, Update.class})
    @Min(value = -1, message = "状态不合法", groups = {Insert.class, Update.class})
    public Integer state;
}
